FROM openjdk:17.0.2-oraclelinux8

MAINTAINER tanyp

RUN mkdir -p /home/server/logs \
    /home/server/temp
WORKDIR /home/server

ENV SERVER_PORT=8080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""

EXPOSE ${SERVER_PORT}

ADD ./target/app-admin.jar ./app.jar

ENTRYPOINT java -server -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} -Dspring.profiles.active=dev \
           -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF8 -Djava.awt.headless=true \
           ${JAVA_OPTS} -XX:+UseZGC -XX:+DisableExplicitGC -XX:-UseLargePages \
           -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/server/logs/ \
           -jar app.jar

